package com.mop.app.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mop.app.dal.query.AppSourceQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.*;
import com.mop.app.dal.entity.AppSource;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mop.app.common.PageQueryWrapper;

import org.springframework.web.bind.annotation.RestController;
import com.mop.app.common.BaseController;
import com.mop.app.service.AppSourceService;

import java.util.List;
/**
 * 资源表
 *
 * @author wchen
 * @since 2020-02-27
 */
@RestController
@RequestMapping("/open/source")
public class SourceController extends BaseController {

    @Autowired
    private AppSourceService appSourceService;




    /**
     * 资源列表分页查询
     *
     * @param query 默认使用实体作为查询参数，可根据业务需要替换为查询对象，如若替换为查询对象，请修改相应mapper文件的sql查询
     * @return 分页结果集
     */
    @PostMapping("/list")
    public Page<AppSource> list(@RequestBody PageQueryWrapper<AppSourceQuery> query) {
        query.setQueryClazz(AppSourceQuery.class);
        Page pageList = appSourceService.pageQuery(query);
        return pageList;
    }



}

